<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
       <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>${title }</title>
    <link rel="stylesheet" href="${basePath}/static/bootstrap/css/bootstrap.css"/>
    <link href="${basePath}/static/css/basic.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/login.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/list.css" rel="stylesheet" type="text/css">
    <script  type="text/javascript" src="${basePath}/static/js/jquery.min.js"></script>
	<script  type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${basePath}/static/page/jqPaginator/jqPaginator.js"></script>
    
</head>
<body>
<!--头部-->
	<%@include file="/WEB-INF/templates/common/header.jsp"%>
	<!------导航条-->
	<%@include file="/WEB-INF/templates/common/navigation.jsp"%>

<!--内容部分-->
<div class="list_main lay_out" class="clearfix">
    <div class="list_DH">
        <%@include file="/WEB-INF/templates/common/indexPageAudit.jsp"%>
    </div>
    <div class="list_NR">
        <div class="loc">
            <h3 style="margin:0">质控详情</h3>
        </div>
        <div class="list_con_table">
     <!--        <div class="search_table">
                <ul class="clearfix" style="margin-bottom:0;">
                	<li class="Label_1" >出院日期：&nbsp;</li>
                    <li class="Label_4" style="text-align:left;padding-left:3px;width:280px"><input class="input_box" style="width:120px;" type=""  name='startTime' id='outHospitalStartDate' value='2017-05-01' onFocus="WdatePicker()" /><span>&nbsp;-&nbsp;</span><input class="input_box" type="" style="width:120px;"  name='endTime' id='outHospitalEndDate' value='2017-05-31' onFocus="WdatePicker()" /></li>
                   
                    <li class="Label_5">
                        <div class="right" style="text-align:right">
                            <a onclick="searchQua()">查询</a>
                         
                        </div>
                    </li>
                  
                </ul>
            </div> --> 
             <table class="Search_tableList" cellpadding="0" cellspacing="0">
                <tr>
             		<td class="tdLabel_4">唯一标示</td>
                    <td class="tdLabel_4">识别码</td>
                    <td class="tdLabel_4">姓名</td>
                 
                    <td class="tdLabel_4">质控时间</td>
                    <td class="tdLabel_4">质控内容</td>
                    <td class="tdLabel_4">质控扣分</td>
                    <td class="tdLabel_4">质控人</td>
            
                    <td class="tdLabel_4">质控评分</td>
                    <td class="tdLabel_4">病案等级</td>
                </tr>
                
                <tbody id="tbody">
                	<tr>
                	 <td class="tdLabel_5">1-20150611011</td>
                    <td class="tdLabel_5">20150611011</td>
                    <td class="tdLabel_5">刘东亮</td>
                    
                     
                  
                    <td class="tdLabel_5">2017-05-27</td>
                   <td class="tdLabel_5">医嘱签名模糊</td>
                     <td class="tdLabel_5">1.0</td>
                      <td class="tdLabel_5">陈磊</td>
                    
                       <td class="tdLabel_5">99</td>
                        <td class="tdLabel_5">甲</td>
                	</tr>
                	        	<tr>
                	 <td class="tdLabel_5">1-20150611011</td>
                    <td class="tdLabel_5">20150611011</td>
                    <td class="tdLabel_5">刘东亮</td>
                    
                     
                  
                    <td class="tdLabel_5">2017-05-27</td>
                   <td class="tdLabel_5"> 无住院记录</td>
                     <td class="tdLabel_5">3.0</td>
                      <td class="tdLabel_5">陈磊</td>
                    
                       <td class="tdLabel_5">94</td>
                       <td class="tdLabel_5">乙</td>
                	</tr>
                	        	<tr>
                	 <td class="tdLabel_5">1-20150611011</td>
                    <td class="tdLabel_5">20150611011</td>
                    <td class="tdLabel_5">刘东亮</td>
                    
                     
                  
                    <td class="tdLabel_5">2017-05-27</td>
                   <td class="tdLabel_5">无医师签名</td>
                     <td class="tdLabel_5">2.0</td>
                      <td class="tdLabel_5">陈磊</td>
                    
                       <td class="tdLabel_5">92</td>
                       <td class="tdLabel_5">乙</td>
                	</tr>
                	
                </tbody>
            </table>
        </div>
        <!-- <div class="pageList">
            <ul class="pagination clearfix" id="page_plus"></ul>
            <div class="pagination">
                <div>总共：<b id="totalPage">0</b> 条信息    当前页是第 <b id="currentPage">0/0</b>　页</div>
            </div>
        </div> -->
    </div>
</div>
<!------页脚部分--------->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>

<!--JS部分-->
<script type="text/javascript">
	
	

	function queryQua(currentStartNum,pageSize){
		
		var name=$("#name").val();
		var idCard=$("#idCard").val();
		var outHospitalStartDate=$("#outHospitalStartDate").val();
		var outHospitalEndDate=$("#outHospitalEndDate").val();
		
		if((outHospitalStartDate==null || outHospitalStartDate=="") && (outHospitalEndDate==null || outHospitalEndDate=='') && (name==null || name=='') && (idCard==null || idCard=='')){
			alert("请输入查询条件!");
			return;
		}
		jQuery.support.cors = true;
		$.ajax({
			type:"get",
			url:"http://localhost:8888/medical-manage/statis/queryMedrecordByAjax",
			data:{idCard:idCard,outHospitalStartDate:outHospitalStartDate,outHospitalEndDate:outHospitalEndDate,name:name,currentStartNum:currentStartNum,pageSize:pageSize},
			success:function(data){
				$("#tbody").html("");
				
				if(data.success){
					var hospitalizationNotes=data.data.hospitalizationNotes;
					var medRecordQuery=data.data.medRecordQuery;
			
					var totalCounts=medRecordQuery.totalCounts;
					var html="";
					for(var i=0;i<hospitalizationNotes.length;i++){
						var hospitalizationNote=hospitalizationNotes[i];
						html+=" <tr>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.mr_id+"</td>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.name+"</td>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.id_number+"</td>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.out_hospital_date+"</td>"+
				              "      <td class='tdLabel_5' style='width:280px'><a onclick='borrow(this)'>批准</a></td>"+
				              "  </tr>";
					}
					
					$("#tbody").html(html);
					page(currentStartNum+1,totalCounts);
					
				}
	
			}
		})
		
	}
	
	 function page(currentPage,totalCounts){

	    	//var totalCounts = 1000;
	        var pageSize = 20;
	        var visiblePages = 10;
	        //var currentPage = 1;
	        /* var totalPages = totalCounts%pageSize==0?(totalCounts/pageSize):(totalCounts/pageSize+1); */
	        var totalPages = Math.ceil(totalCounts/pageSize);
	        $('#page_plus').jqPaginator({

	            totalCounts: totalCounts,
	            pageSize:pageSize,
	            visiblePages: visiblePages,
	            currentPage: currentPage,

	            first:'<li class="first"><a href="javascript:void(0);">首页</a></li>',
	            prev: '<li class="prev"><a href="javascript:void(0);">上一页</a></li>',
	            next: '<li class="next"><a href="javascript:void(0);">下一页</a></li>',
	            last: '<li class="last"><a href="javascript:void(0);">末页</a></li>',
	            page: '<li class="page"><a href="javascript:void(0);">{{page}}</a></li>',
	            onPageChange: function (num,type) {
	          
	            	 if(type !='init'){
	                 
	            		 queryQua(num-1,pageSize);
	                 }
	            	
	                $("#totalPage").html(totalCounts);
	                $("#currentPage").html(num+"/"+totalPages);
	            }
	        });

	    }
	 
	 
		function borrow(obj){
			alert("借阅申请已批准!");
			$(obj).parents("tr").fadeOut("slow",function(){
				$(this).remove();
			});
		}
	
</script>

</body>
</html>